package dcpb.re.encryption;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import it.unisa.dia.gas.jpbc.Element;

public class Proxy {
	private ProxyReEncrypt  d=new ProxyReEncrypt ();
	private Element x,y;
	private Map c;
	public Proxy(Element x,Element y) {
		// TODO Auto-generated constructor stub
		this.x=x;
		this.y=y;
	}
	public void reEnc(Map C,Element rkw_1) throws IOException {
		int t=3;
		Map<String,Element> c1=null;
		   
		c1=d.ReEnc(C,rkw_1, y);
		c1.put("x", x);
		this.c=c1;
		
//		Map<String,byte[]> idbytes=new HashMap<>();
//    	for(Map.Entry<String,Element> id:c1.entrySet()) {
//    		idbytes.put(id.getKey(),id.getValue().toBytes());
//    	}
//    	String path="data/reEnc";
//    	FileOutputStream fwriter = new FileOutputStream(path);
//    	ObjectOutputStream objectOutputStream = new ObjectOutputStream(fwriter);
//    	objectOutputStream.writeObject(idbytes);
	}
	public Map getC() {
		return this.c;
	}

}
